const open = require("open");
const {
  authorizeUrl
} = require("../config");
const requset = require("./requset");
exports.isLogin = async function () {
  let res = await requset({
    method: "get",
    url: `/hello`
  });
  if (res.status == 200) {
    return true;
  } else {
    if (res.status === 401) {
      console.log('token错误，请重新申请token');
      open(authorizeUrl)
    }
    return false
  }

}